package Kuaishou;

import java.lang.reflect.Type;
import java.util.Arrays;

/**
 * 测试GenericInterfaces 该方法只能拿到子类直接实现的接口信息，获取不到通过父类继承的接口信息
 * @author leiwenkang <leiwenkang@kuaishou.com>
 * Created on 2020-09-23
 */
public class Test07GenericInterfaces {
    public static void main(String[] args) {
        A a = new A();
        Type[] interfaces = a.getClass().getInterfaces();
        Type[] genericInterfaces = a.getClass().getGenericInterfaces();
        Type genericSuperclasses = a.getClass().getGenericSuperclass();
        System.out.println("interfaces : " + Arrays.toString(interfaces));
        System.out.println("genericInterfaces : " + Arrays.toString(genericInterfaces));
        System.out.println("genericSuperclasses : " + genericSuperclasses);
    }
}

class A extends abstractA<Stu> implements interfaceA<Stu>{

}

abstract class abstractA<T> {

}

interface interfaceA<T> {

}

class Stu{

}
